Optimal. Leaf size=143 \[ \frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (A-i B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 143, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.132, Rules used = {3677, 3679, 12,
3625, 211} \begin {gather*} \frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}}+\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (A-i B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 211
Rule 3625
Rule 3677
Rule 3679
Rubi steps
\begin {align*} \int \frac {A+B \tan (c+d x)}{\tan ^{\frac {3}{2}}(c+d x) \sqrt {a+i a \tan (c+d x)}} \, dx &=\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}+\frac {\int \frac {\sqrt {a+i a \tan (c+d x)} \left (\frac {1}{2} a (3 A+i B)-a (i A-B) \tan (c+d x)\right )}{\tan ^{\frac {3}{2}}(c+d x)} \, dx}{a^2}\\ &=\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}}+\frac {2 \int \frac {a^2 (i A+B) \sqrt {a+i a \tan (c+d x)}}{4 \sqrt {\tan (c+d x)}} \, dx}{a^3}\\ &=\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}}+\frac {(i A+B) \int \frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {\tan (c+d x)}} \, dx}{2 a}\\ &=\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}}+\frac {(a (A-i B)) \text {Subst}\left (\int \frac {1}{-i a-2 a^2 x^2} \, dx,x,\frac {\sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{d}\\ &=\frac {\left (\frac {1}{2}+\frac {i}{2}\right ) (A-i B) \tanh ^{-1}\left (\frac {(1+i) \sqrt {a} \sqrt {\tan (c+d x)}}{\sqrt {a+i a \tan (c+d x)}}\right )}{\sqrt {a} d}+\frac {A+i B}{d \sqrt {\tan (c+d x)} \sqrt {a+i a \tan (c+d x)}}-\frac {(3 A+i B) \sqrt {a+i a \tan (c+d x)}}{a d \sqrt {\tan (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.04, size = 181, normalized size = 1.27 \begin {gather*} \frac {\left (\frac {(A-i B) \sqrt {-1+e^{2 i (c+d x)}} \tanh ^{-1}\left (\frac {e^{i (c+d x)}}{\sqrt {-1+e^{2 i (c+d x)}}}\right )}{\sqrt {-\frac {i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}}}+\frac {-4 A \cos (c+d x)+2 (-3 i A+B) \sin (c+d x)}{\sqrt {\tan (c+d x)}}\right ) (A+B \tan (c+d x))}{2 d (A \cos (c+d x)+B \sin (c+d x)) \sqrt {a+i a \tan (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 700 vs. \(2 (117 ) = 234\).
time = 0.14, size = 701, normalized size = 4.90
method | result | size |
derivativedivides | \(-\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )+2 i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )-A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )-i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \tan \left (d x +c \right )+4 i B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+2 B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )-20 i A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \tan \left (d x +c \right )+12 A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+4 B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )-8 A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\right )}{4 d a \sqrt {\tan \left (d x +c \right )}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (-\tan \left (d x +c \right )+i\right )^{2} \sqrt {-i a}}\) | \(701\) |
default | \(-\frac {\sqrt {a \left (1+i \tan \left (d x +c \right )\right )}\, \left (i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )+2 i A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )-A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{3}\left (d x +c \right )\right )-i B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \tan \left (d x +c \right )+4 i B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+2 B \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \left (\tan ^{2}\left (d x +c \right )\right )-20 i A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )+A \sqrt {2}\, \ln \left (-\frac {-2 \sqrt {2}\, \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}+i a -3 a \tan \left (d x +c \right )}{\tan \left (d x +c \right )+i}\right ) a \tan \left (d x +c \right )+12 A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (\tan ^{2}\left (d x +c \right )\right )+4 B \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \tan \left (d x +c \right )-8 A \sqrt {-i a}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\right )}{4 d a \sqrt {\tan \left (d x +c \right )}\, \sqrt {a \tan \left (d x +c \right ) \left (1+i \tan \left (d x +c \right )\right )}\, \left (-\tan \left (d x +c \right )+i\right )^{2} \sqrt {-i a}}\) | \(701\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 473 vs. \(2 (109) = 218\).
time = 0.72, size = 473, normalized size = 3.31 \begin {gather*} \frac {\sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} - a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a d^{2}}} \log \left (\frac {\sqrt {2} a d \sqrt {-\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} + \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) - \sqrt {2} {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} - a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {-\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a d^{2}}} \log \left (-\frac {\sqrt {2} a d \sqrt {-\frac {-i \, A^{2} - 2 \, A B + i \, B^{2}}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} - \sqrt {2} {\left ({\left (i \, A + B\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 i \, A + 4 \, B}\right ) - 2 \, \sqrt {2} {\left ({\left (5 i \, A - B\right )} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 i \, A e^{\left (2 i \, d x + 2 i \, c\right )} - i \, A + B\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{4 \, {\left (a d e^{\left (3 i \, d x + 3 i \, c\right )} - a d e^{\left (i \, d x + i \, c\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {A + B \tan {\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \tan ^{\frac {3}{2}}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {A+B\,\mathrm {tan}\left (c+d\,x\right )}{{\mathrm {tan}\left (c+d\,x\right )}^{3/2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________